package com.ckv.qcm.view.trainees;

import java.awt.Color;
import java.awt.FlowLayout;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.border.Border;

import com.ckv.qcm.model.Trainee;
import com.ckv.qcm.view.Utils.ElementPanel;

public class StagiairePanel extends ElementPanel {

	private Trainee stagiaire;
	private Border border;
	private JLabel labelNom;
	private JLabel labelPrenom;

	
	public StagiairePanel(Trainee stagiaire) {
		super();
		this.stagiaire = stagiaire;
		initComponent();
	}

	public StagiairePanel(int width, int height, Trainee stagiaire) {
		super(width, height);
		this.stagiaire = stagiaire;
		initComponent();
	}

	private void initComponent()
	{
		this.border = BorderFactory.createLineBorder(Color.black);
		this.setLayout(new FlowLayout(FlowLayout.LEFT));
		
		this.labelNom = new JLabel(stagiaire.getName());
		this.labelNom.setAlignmentY(CENTER_ALIGNMENT);
		this.labelNom.setVerticalAlignment(JLabel.CENTER);
		
		this.add(labelNom);
		
		this.labelPrenom = new JLabel(stagiaire.getFirstName());
		this.labelPrenom.setAlignmentY(CENTER_ALIGNMENT);
		this.labelPrenom.setVerticalAlignment(JLabel.CENTER);
		this.add(labelPrenom);
		this.setBorder(border);
	}

	@Override
	public void focus() 
	{
		// TODO Auto-generated method stub
		
	}

	@Override
	public void switchMode(Mode mode) 
	{
		// TODO Auto-generated method stub
		
	}}
